package com.itmk.business.article.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.itmk.business.articleCategory.entity.ArticleCategory;
import com.itmk.system.user.entity.SysUser;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName(value = "comment")
public class Comment {
    @TableId
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long commentId;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long mainId;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long parentId;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long contactId;
    private String content;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long articleId;
    private Boolean visible;

    public Comment(Long commentId, Boolean visible) {
        this.commentId = commentId;
        this.visible = visible;
    }

    public Comment() {
    }

    //    对评论的操作 1屏蔽 2恢复
    @TableField(exist = false)
    private Integer state;
}
